using System;
using Godot;
using Common;

namespace DRE {
	public class Menu : Node {
		Control functions;
		TextWriter.TextWriter descriptionObj;

		bool descriptionVisible;
		public bool DescriptionVisible {
			get => descriptionVisible;
			set {
				descriptionVisible = value;
				functions.Visible = !DescriptionVisible;
				descriptionObj.Visible = DescriptionVisible;
			}
		}
		public string DescriptionText {
			get => descriptionObj.Text;
			set {
				if (DescriptionText == value) {
					return;
				}
				descriptionObj.Text = "{Instant 1}" + value;
				descriptionObj.Restart();
			}
		}

		public enum Mode {
			Buttons,
			Item,
			Equip,
			Power,
			Config
		}
		Mode currentMode;
		public Mode CurrentMode {
			get => currentMode;
			set {
				currentMode = value;
				//TODO: ADD FUNCTIONS
			}
		}

		public override void _Ready() {
			functions = GetNode<Control>("Upper/Function");
			descriptionObj = GetNode<TextWriter.TextWriter>("Upper/Description");

			CurrentMode = Mode.Buttons;
			DescriptionVisible = false;
		}
		public override void _Process(float delta) {

		}
	}
}